﻿@model AdventureWorks.Web.Models.GeneralViewModel

@{
    ViewBag.Title = "Index";
}

<script type="text/javascript">
    jQuery(document).ready(function () {
        jQuery("#list").jqGrid({
            url: '/AdventureWorks.Web/Product/Grid',
            datatype: 'json',
            mtype: 'GET',
            colNames: ['Id', 'Votes', 'Title'],
            colModel: [
          { name: 'Id', index: 'Id', width: 40, align: 'left' },
          { name: 'Votes', index: 'Votes', width: 40, align: 'left' },
          { name: 'Title', index: 'Title', width: 200, align: 'left'}],
            pager: jQuery('#pager'),
            rowNum: 10,
            rowList: [5, 10, 20, 50],
            sortname: 'Id',
            sortorder: "desc",
            viewrecords: true,
            imgpath: '/scripts/themes/coffee/images',
            caption: 'My first grid'
        });
    }); 
</script>

<h2>My Grid Data</h2>
<table id="list" class="scroll" cellpadding="0" cellspacing="0"></table>
<div id="pager" class="scroll" style="text-align:center;"></div>